翻訳と辞書
Words near each other
・ Call signs in Australia
・ Call signs in Barbados
・ Call signs in Canada
・ Call signs in Europe
・ Call signs in Ireland
・ Call signs in New Zealand
・ Call signs in North America
・ Call signs in Oceania
・ Call signs in South Africa
・ Call signs in South America
・ Call signs in the United Kingdom
・ Call signs in the United States
・ Call site
・ Call stack
・ Call Street Historic District
Call super
・ Call Taxi (India)
・ Call termination
・ Call the Doctor
・ Call the Man
・ Call the Mesquiteers
・ Call the Midwife
・ Call the Midwife (book)
・ Call the Police
・ Call the Shots
・ Call the Time Eternity
・ Call this a home?
・ Call to Action
・ Call to action
・ Call to action (marketing)


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Call super : ウィキペディア英語版
Call super

Call super is a code smell or anti-pattern of some object-oriented programming languages. Call super is a design pattern in which a particular class stipulates that in a derived subclass, the user is required to override a method and call back the overridden function itself at a particular point. The overridden method may be intentionally incomplete, and reliant on the overriding method to augment its functionality in a prescribed manner. However, the fact that the language itself may not be able to enforce all conditions prescribed on this call is what makes this an anti-pattern.
== Description ==

In object-oriented programming, users can inherit the properties and behaviour of a superclass in subclasses. A subclass can override methods of its superclass, substituting its own implementation of the method for the superclass's implementation. Sometimes the overriding method will completely replace the corresponding functionality in the superclass, while in other cases the superclass's method must still be called from the overriding method. Therefore most programming languages require that an overriding method must explicitly call the overridden method on the superclass for it to be executed.
The call super anti-pattern relies on the users of an interface or framework to derive a subclass from a particular class, override a certain method and require the overridden method to call the original method from the overriding method:〔(【引用サイトリンク】 title=MF Bliki: CallSuper )
This is often required, since the superclass must perform some setup tasks for the class or framework to work correctly, or since the superclass's main task (which is performed by this method) is only augmented by the subclass.
Note that it is the ''requirement'' of calling the parent that is the anti-pattern. There are many examples in real code where the method in the subclass may still want the superclass's functionality, usually where it is only augmenting the parent functionality. If it still has to call the parent class even if it is fully replacing the functionality, we have the anti-pattern in force.
A better approach to solve these issues is instead to use the template method pattern, where the superclass includes a purely abstract method that must be implemented by the subclasses and have the original method call that method:〔

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Call super」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.